The technology described herein relates to graphics processing systems and in particular to mechanisms for culling primitives, e.g. prior to rasterisation, in a graphics processing pipeline.
Graphics processing is normally carried out by first splitting a scene (e.g. a 3-D model) to be displayed into a number of similar basic components or “primitives”, which primitives are then subjected to the desired graphics processing operations. The graphics “primitives” are usually in the form of simple polygons, such as triangles.
The primitives for an output such as a frame to be displayed are usually generated by the applications program interface for the graphics processing system, using the graphics drawing instructions (requests) received from the application (e.g. game) that requires the graphics processing.
Each primitive is usually defined by and represented as a set of vertices. Each vertex for a primitive typically has associated with it a set of “attributes”, i.e. a set of data values for the vertex. These attributes will typically include position data and other, non-position data (varyings), e.g. defining colour, light, normal, texture coordinates, etc., for the vertex in question.
For a given output, e.g. frame to be displayed, to be generated by the graphics processing system, there will typically be a set of vertices defined for the output in question. The primitives to be processed for the output will then be indicated as comprising given vertices in the set of vertices for the graphics processing output being generated. Typically, the overall output, e.g. frame to be generated, will be divided into smaller units of processing, referred to as “draw calls”. Each draw call will have a respective set of vertices defined for it and a set of primitives that use those vertices.
Once primitives and their vertices have been generated and defined, they can be processed by the graphics processing system, in order to generate the desired graphics processing output (render target), such as a frame for display. This basically involves rasterising and rendering the primitives to generate the graphics processing output (using the vertex attributes associated with the vertices of the primitives that are being processed).
Some graphics processing units operate as “tile based” graphics processing pipelines, in which the two-dimensional graphics processing output or target (i.e. the output of the rendering process, such as an output frame to be displayed) is rendered as a plurality of smaller area sub-regions, usually referred to as “tiles”. The tiles are each rendered separately (typically one after another). The rendered tiles are then combined to provide the complete rendering output (e.g. frame for display). In such arrangements, the render target (output) is typically divided (by area) into regularly-sized and shaped rendering tiles (they are usually e.g., squares or rectangles) but this is not essential.
Other terms that are commonly used for “tiling” and “tile-based” rendering include “chunking” (the rendering tiles are referred to as “chunks”) and “bucket” rendering. The terms “tile” and “tiling” will be used hereinafter for convenience, but it should be understood that these terms are intended to encompass all alternative and equivalent terms and techniques.
In tile-based graphics processing, the primitives to be processed for a given output (e.g. that make up the draw call currently being processed) are sorted into respective primitive lists (tile lists) that indicate for the tiles that the graphics processing output (render target) has been divided into for processing purposes, which primitives are to be processed for each tile. There may in this regard be a primitive list for each tile individually, or primitive lists that encompass multiple tiles may also or instead be provided. A given primitive may be included in more than one primitive list, e.g. where the primitive falls in more than one tile. The graphics processor and processing pipeline normally includes an appropriate tiler (tiling stage) that sorts the primitives into the respective primitive lists for this purpose.
The primitive lists are then used to determine which primitives should be rasterised and rendered when processing a given tile of the graphics processing output.
The primitive sorting (tiling) operation is normally carried out after the primitives for the render output have been “assembled” (i.e. after the vertices and the corresponding vertex connectivity information for the render output has been used to assemble the set of vertices for the render output into the required set of primitives), but before any rasterisation of the primitives.
It is accordingly advantageous to try to cull (discard) primitives from further processing at or before the tiling operation, so as to reduce the number of primitives that are sorted into the tile lists (and thus accordingly that are subsequently processed (at least rasterised)).
An example of such primitive culling is view frustum culling. In this case, it is determined whether a primitive falls completely outside the view frustum for the output that is being generated, and, if it does, the primitive is then discarded (and not sorted by the tiler into the tile lists). This then avoids primitives that fall completely outside the view frustum being processed by the tiler into tile lists (and processed further in the graphics processing pipeline).
The Applicants believe that there remains scope for improved primitive culling operations, particularly in the case of tile-based graphics processing units.
Like reference numerals are used for like features where appropriate in the drawings.